using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class _Default : System.Web.UI.Page 
{

    protected void BukaLogin_LoggedIn(object sender, EventArgs e)
    {
        loginLink.Visible = false;
        System.Text.StringBuilder sb = new System.Text.StringBuilder();
        sb.Append(@"<script type=""text/javascript"" language=""javascript"">");
        sb.Append(@"function HideElement()
        {
            document.getElementById('loginLink').style.visibility = ""hidden"";
        }");
        sb.Append(@"</script>");
        Page.ClientScript.RegisterClientScriptBlock(typeof(Page), "script", sb.ToString());
        //Buka.Membership.BukaMembershipUser u=new MembershipUser().
        
    }
    protected void loginStatus_LoggingOut(object sender, LoginCancelEventArgs e)
    {
        //loginLink.Visible = true;
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        SetVisibility();
    }
    public void SetVisibility()
    {
        Buka.BLL.Model.User u = new Buka.BLL.Provider.UserProvider().GetUserByUsername(Page.User.Identity.Name);
        loginLink.Visible = (u == null);
        loginStatus.Visible = !loginLink.Visible;
    }
}
